﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccess.Model;
using BusinessEntity = Business.ValueObject.SISCONVE;

namespace DataAccess.DNPC.Mapper
{
    public static class Mapper
    {
        public static CacheStatusDetailVehicle MapBusinessVOStatusDetailVehicleToCacheStatusDetailVehicleModelData(BusinessEntity.VOStatusDetailVehicle businessEntity)
        {
            CacheStatusDetailVehicle entity = new CacheStatusDetailVehicle
            {
                MIId = businessEntity.MIId,
                LastData = businessEntity.LastData,
                ReceptionLastData = businessEntity.ReceptionLastData,
                LastDataWithInformation = businessEntity.LastDataWithInformation,
                ReceptionLastDataWithInformation = businessEntity.ReceptionLastDataWithInformation,
                Speed = businessEntity.Speed,
                SignalGPS = businessEntity.SignalGPS,
                SignalGPSR = (int)businessEntity.SignalGPSR,
                PositionACC = (int)businessEntity.PositionACC,
                BatteryConnection = (int)businessEntity.BatteryConnection,
                KeyByPass = (int)businessEntity.KeyByPass,
            };

            return entity;
        }

        public static CachePerformanceReportVehicle MapBusinessVOPerformanceReportVehicleToCachePerformanceReportVehicleModelData(BusinessEntity.VOPerformanceReportVehicle businessEntity)
        {
            CachePerformanceReportVehicle entity = new CachePerformanceReportVehicle
            {
                MIId = businessEntity.MIId,
                Fuel = businessEntity.Fuel,
                Dispatches = businessEntity.Dispatches,
                Distance = businessEntity.Distance,
                Volume = businessEntity.Volume,
                Performance = businessEntity.Performance,
                EngineHours = businessEntity.EngineHours,
                EnginePerformance = businessEntity.EnginePerformance
            };

            return entity;
        }

        public static CacheReportVehicle MapBusinessVOReportVehicleToCacheReportVehicleModelData(BusinessEntity.VOReportVehicle businessEntity)
        {
            CacheReportVehicle entity = new CacheReportVehicle
            {
                MIId = businessEntity.MIId,
                Fuel = businessEntity.Fuel,
                Active = businessEntity.Active,
                BlackList = businessEntity.BlackList,
                Brand = businessEntity.Brand,
                CardId = businessEntity.CardId,
                DispatchKeyRequire = businessEntity.DispatchKeyRequire,
                FleetName = businessEntity.FleetName,
                Id = businessEntity.Id,
                IdDivision = businessEntity.IdDivision,
                Installed = businessEntity.Installed,
                Model = businessEntity.Model,
                NameDivision = businessEntity.NameDivision,
                Notes = businessEntity.Notes,
                OnlyFleet = businessEntity.OnlyFleet,
                OrganizationId = businessEntity.OrganizationId,
                TankCapacity = businessEntity.TankCapacity,
                TankCapacityDesc = businessEntity.TankCapacityDesc,
                TRU_Model = businessEntity.TRU_Model,
                UnitId = businessEntity.UnitId,
                VehicleType = (int)businessEntity.VehicleType,
                Year = businessEntity.Year
            };

            return entity;
        }
    }
}
